import axios from 'axios';

const API_BASE_URL = '/api/admin/items';

export const getInventory = () => {
  return axios.get(API_BASE_URL);
};

export const createItem = (itemData) => {
  return axios.post(API_BASE_URL, itemData);
};

export const updateItem = (itemId, itemData) => {
  return axios.put(`${API_BASE_URL}/${itemId}`, itemData);
};

export const deleteItem = (itemId) => {
  return axios.delete(`${API_BASE_URL}/${itemId}`);
};

export const getUserInventory = (userId) => {
  return axios.get(`/api/inventories/user/${userId}`);
};

export default {
  getInventory,
  createItem,
  updateItem,
  deleteItem,
  getUserInventory,
};
